//
//  NewsCell.m
//  TodayComment
//
//  Created by 张吉阳 on 15/9/15.
//  Copyright (c) 2015年 xianrenmoshi. All rights reserved.
//

#import "CommentCell.h"
#import "NewsInfo.h"
#import "FxDownload.h"
#import "FxDBManager.h"
#import "DKNightVersion.h"
@implementation CommentCell


- (void)initCell
{
     [super initCell];
//   self.nightBackgroundColor = UIColorFromRGB(0x343434);
//   _contentCommentLabel.nightTextColor = [UIColor darkGrayColor];

    //RegisterNotify(NofifyNewsIcon, @selector(downloadIcon:));
}


- (void)dealloc
{
    RemoveNofify;
}

- (void)setCellData:(CommentInfo *)commentInfo
{
    [super setCellData:commentInfo];
    self.info = commentInfo;
    _contentCommentLabel.text = commentInfo.commentContent;
    _replyCount.text = commentInfo.commentCount;
    
    [[FxDownload download] setCommentIcon:commentInfo imageView:_imageView];
   
  
}
- (void)downloadIcon:(NSNotification *)notification
{
    NSDictionary *dict = [notification object];
    CommentInfo *info = [dict objectForKey:@"info"];
    
    if ([info.ID isEqualToString:self.cellInfo.ID]) {
        UIImage *image = [dict objectForKey:@"data"];
        _imageView.image = image;
    }
}




- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    self.nightBackgroundColor = UIColorFromRGB(0x343434);
    _contentCommentLabel.nightTextColor = [UIColor darkGrayColor];
    RegisterNotify(NofifyNewsIcon, @selector(downloadIcon:));
}

@end
